using UnityEngine;

[System.Serializable]
public class ShadowSettings {

	[Min(0.001f)]
	public float maxDistance = 100f;
	[Range(0.001f, 1f)]
	public float distanceFade = 0.1f;
	public enum TextureSize {
		_256 = 256, _512 = 512, _1024 = 1024,
		_2048 = 2048, _4096 = 4096, _8192 = 8192
	}
	public enum FilterMode {
		off, PCF3x3, PCF5x5, PCF7x7
	}

	public bool cascadeShadowTest = false;


	[System.Serializable]
	public struct Directional {
		public TextureSize atlasSize;

		public FilterMode filter;
		[Range(0.0f, 0.01f)]
		public float myPCFFilterSize;
		[Range(0.0f, 0.01f)]
		public float myPCFFilterBias;
		[Range(0.0f, 0.1f)]
		public float myPCSSFilterSize;
		[Range(1, 4)]
		public int cascadeCount;
		[Range(0f, 1f)]
		public float cascadeRatio1, cascadeRatio2, cascadeRatio3;
		public Vector3 CascadeRatios =>
			new Vector3(cascadeRatio1, cascadeRatio2, cascadeRatio3);
		[Range(0.001f, 1f)]
		public float cascadeFade;
	}

	public Directional directional = new Directional {
		atlasSize = TextureSize._1024,
		cascadeCount = 4,
		cascadeRatio1 = 0.1f,
		cascadeRatio2 = 0.25f,
		cascadeRatio3 = 0.5f,
		cascadeFade = 0.1f,
		filter = FilterMode.off,
		myPCFFilterSize = 0.0f,
		myPCSSFilterSize = 0.0f,
	};

	[System.Serializable]
	public struct Other {

		public TextureSize atlasSize;

		public FilterMode filter;
	}

	public Other other = new Other {
		atlasSize = TextureSize._1024,
		filter = FilterMode.PCF3x3
	};
}